<template>
<div>
<myMenu></myMenu>
  <div style='margin:20px'>
    <input  id='inputEmail3' placeholder="请输入账号" v-model='account'>
    <input type='password'  id='inputPassword3' placeholder="请输入密码" v-model='password'>
      <input type='password'  id='inputPassword4' placeholder="请确认密码" v-model='surePassword'>
    <button type='submit' @click='register'>注册</button>
  </div>
</div>
</template>
<script>
import myMenu from '@/components/Menu'
    export default{
        components:{myMenu},
        data(){
            return {
                account:'',
                password:'',
                surePassword:'',
            }
        },
        methods:{
            register(){
              this.$http.post('/api/login/createAccount',{},{
                          params:{
                            account:this.account,
                            password:this.password,
                          }
                          }).then(
                            function(res){
                                if(res.body.code){
                                  alert(res.body.message)
                                }else{
                                  alert(res.body.message)
                                }
                            },function(err){
                                console.log(err);
                            })

            }
        }
    }
</script>
